package com.lyp.qczp.service;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.lyp.qczp.dao.Modulesdao;
import com.lyp.qczp.entity.Modules;
@Service
public class ModulesServiceImp implements ModulesService{
	@Autowired
	private Modulesdao modulesdao;

	@Override
	public Integer insertModules(Modules modules) {
		Modules save = modulesdao.save(modules);
		if (save!=null) {
			return 1;
		}
		return 0;
	}

	@Override
	public Integer deleteModules(Integer mId) {
		modulesdao.deleteById(mId);
		return 1;
	}

	@Override
	public Integer updateModules(Modules modules) {
		Modules save = modulesdao.save(modules);
		if (save!=null) {
			return 1;
		}
		return 0;
	}

	@Override
	public Modules findBymId(Integer mId) {
		// TODO Auto-generated method stub
		return modulesdao.findBymId(mId);
	}
	
}
